home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Topik / Topik - Disk 15 - Nifty (19xx)(Topik Public Domain)(PD)[WB].zip / Topik - Disk 15 - Nifty (19xx)(Topik Public Domain)(PD)[WB].adf / Hilbert / Hilbert.asm < prev    next >
Assembly Source File  |  1989-08-07  |  26KB  |  703 lines

  1. *****************************************************************************
  2. *
  3. *                     Hilbert (c) 1987 The Puzzle Factory
  4. *
  5. *  Program:  Hilbert.asm  V0.6                          Author: Jeff Lavin
  6. *            Based on a recursive algorithm            Created: 10/28/87
  7. *            by Michael Ackerman                   Last Update: 12/01/87
  8. *            from BYTE - June 1986
  9. *
  10. *      Use:  1> [run] Hilbert
  11. *
  12. *     >> No warrantee of any kind whatsoever expressed or implied! <<
  13. *
  14. *       I can be reached at:     The Symposium
  15. *                             Amiga Development BBS
  16. *                        1 Meg Memory - 33 Meg Hard Drive
  17. *                     300/1200, 8-N-1, 24 hr, (503) 935-7883
  18. *                           Another Citadel-68K BBS
  19. *
  20. *****************************************************************************
  21.  
  22. *** Equates
  23.  
  24. SysBase       equ   4
  25.  
  26. TRUE          equ   1
  27. FALSE         equ   0
  28. NULL          equ   0
  29.  
  30. REV_num       equ   29
  31.  
  32. nw_Screen     equ   $1E
  33. sc_ViewPort   equ   $2C
  34. wd_RPort      equ   $32
  35. wd_UserPort   equ   $56
  36. MP_SIGBIT     equ   $0F
  37. im_Class      equ   $14
  38. im_Code       equ   $18
  39. im_IAddress   equ   $1C
  40.  
  41. SMART_REFRESH equ   $000000
  42. NOCAREREFRESH equ   $020000
  43. ACTIVATE      equ   $001000
  44. BACKDROP      equ   $000100
  45. BORDERLESS    equ   $000800
  46. V_HIRES       equ   $008000
  47. V_LACE        equ   $000004
  48. CUSTOMSCREEN  equ   $00000F
  49.  
  50. MENUENABLED   equ   $0001
  51. MENUPICK      equ   $0100
  52. REQCLEAR      equ   $1000
  53.  
  54. GADGHBOX      equ   $0001
  55. SELECTED      equ   $0080
  56. ENDGADGET     equ   $0004
  57. REQGADGET     equ   $1000
  58. BOOLGADGET    equ   $0001
  59.  
  60. RP_JAM1       equ   0
  61. RP_JAM2       equ   1
  62.  
  63. TOPAZ_EIGHTY  equ   8
  64. FS_NORMAL     equ   0
  65. FPF_ROMFONT   equ   0
  66.  
  67. *** Macros
  68.  
  69. call          macro
  70.               xref    _LVO\1             ;External reference
  71.               jsr     _LVO\1(a6)         ;Call a system routine
  72.               endm
  73.  
  74. MENU          macro
  75.               dc.l    \1                 ;*NextMenu
  76.               dc.w    \2                 ;LeftEdge
  77.               dc.w    0                  ;TopEdge
  78.               dc.w    \3                 ;Width
  79.               dc.w    0                  ;Height
  80.               dc.w    MENUENABLED        ;Flags
  81.               dc.l    \4                 ;*MenuName
  82.               dc.l    \5                 ;*FirstItem
  83.               dc.l    0,0                ;Used by Intuition
  84.               endm
  85.  
  86. ITEM          macro                      ;Make MenuItem
  87.               dc.l    \1                 ;*NextItem
  88.               dc.w    \2                 ;LeftEdge
  89.               dc.w    \3                 ;TopEdge
  90.               dc.w    \4                 ;Width
  91.               dc.w    10                 ;Height
  92.               dc.w    \5                 ;Flags
  93.               dc.l    \6                 ;MutualExclude
  94.               dc.l    \7                 ;*ItemFill
  95.               dc.l    0                  ;*SelectFill
  96.               dc.b    \8                 ;Command
  97.               dc.b    0                  ;KludgeFill00
  98.               dc.l    \9                 ;*SubItem
  99.               dc.w    0                  ;NextSelect
  100.               endm
  101.  
  102. *** Begin Mainline
  103.  
  104. Startup     movea.l SysBase,a6           ;Find exec library
  105.             lea     IntName,a1           ;Ask for 'intuition.library'
  106.             moveq.l #REV_num,d0          ;Any version
  107.             call    OpenLibrary
  108.             move.l  d0,IntBase
  109.             beq     Cleanup
  110.  
  111.             lea     GfxName,a1           ;Ask for 'graphics.library'
  112.             moveq.l #REV_num,d0          ;Any version
  113.             call    OpenLibrary
  114.             move.l  d0,GfxBase
  115.             beq     Cleanup
  116.  
  117.             movea.l IntBase,a6           ;Open a CustomScreen
  118.             lea     MyScreen,a0
  119.             call    OpenScreen
  120.             move.l  d0,ScreenPtr         ;Ptr to newly opened screen
  121.             beq     Cleanup
  122.  
  123.             lea     MyWindow,a0          ;Ptr to window structure
  124.             move.l  d0,nw_Screen(a0)     ;Link NewWindow to our screen
  125.  
  126.             addi.l  #sc_ViewPort,d0
  127.             move.l  d0,ViewPtr           ;Screen -> ViewPort
  128.  
  129.             call    OpenWindow           ;Open Our Main Window
  130.             move.l  d0,WindowPtr         ;Ptr to newly opened window
  131.             beq     Cleanup
  132.  
  133.             movea.l d0,a0
  134.             move.l  wd_RPort(a0),RastPtr ;Save ptr to RastPort
  135.             movea.l wd_UserPort(a0),a0
  136.             move.l  a0,PortPtr              ;Save ptr to UserPort
  137.             move.b  MP_SIGBIT(a0),IntuiBits ;Save signal bits
  138.  
  139.             movea.l GfxBase,a6
  140.             movea.l ViewPtr,a0           ;Screen's ViewPort
  141.             movea.l #NewColors,a1        ;Our ColorTable
  142.             move.l  #16,d0               ;How many colors
  143.             call    LoadRGB4
  144.  
  145.             lea     MyFont,A0
  146.             call    OpenFont             ;Open the 80 column font
  147.             move.l  D0,FontPtr           ; for menus & requesters
  148.             beq     Cleanup
  149.  
  150.             move.b  #0,CloseFlag         ;Else we can't escape
  151.             move.b  #1,ColorFlag         ;Default to color
  152.             move.b  #1,TitleFlag         ;Default to 'ON'
  153.  
  154.             movea.l IntBase,a6           ;Attach menus to existing window
  155.             movea.l WindowPtr,a0         ;Which window?
  156.             lea     Title0,a1            ;First menu in strip
  157.             call    SetMenuStrip         ;Attach menus
  158.             move.l  #1,MenuFlag          ;Indicate it
  159.  
  160. *****  Main Program Loop  -  Event Driven  *****
  161.  
  162. Main        move.b  CloseFlag,d0         ;Have we received a Quit request?
  163.             bne     Cleanup              ;Yes, Bye!
  164.             moveq.l #0,d1
  165.             move.b  IntuiBits,d1
  166.             moveq.l #1,d0
  167.             lsl.l   d1,d0                ;Shift to use as a bit mask
  168.             movea.l SysBase,a6           ;Exec Library ptr
  169.             call    Wait                 ;Now wait for something to happen
  170.  
  171. IntuEvent   bsr     GetIMsg              ;Get an Intuition msg
  172.             tst.l   d0                   ;Did we get a msg?
  173.             beq     Main                 ;No
  174.  
  175.             move.l  MsgClass,d0          ;Type of event
  176.             cmpi.l  #MENUPICK,d0         ;Menu choice?
  177.             beq     MenuEvent
  178.             bra     EventDone            ;Reply to msg
  179.  
  180. MenuEvent   clr.l   d2
  181.             move.w  MsgCode,d2           ;Get all Menu codes
  182.             beq     EventDone            ;User backed out before choosing
  183.  
  184.             move.l  d2,d0                 ;Save the code
  185.             andi.l  #%0000000000011111,d0 ;Get Menu number
  186.             move.b  d0,MenuNum
  187.  
  188.             move.l  d2,d1
  189.             andi.l  #%0000011111100000,d1 ;Get Item number
  190.             lsr.w   #5,d1                 ;Shift into the lower byte
  191.             move.b  d1,ItemNum
  192.  
  193.             andi.l  #%1111100000000000,d2 ;Get SubItem number
  194.             moveq.l #11,d4
  195.             lsr.w   d4,d2                ;Shift into the lower byte
  196.             move.b  d2,SubINum
  197.  
  198. *** Check for Menu Items
  199.  
  200. Menu0_Chk   cmpi.b  #0,d0                ;'Project' menu
  201.             bne     Menu1_Chk
  202. Item00_Ck   cmpi.b  #0,d1                ;'Save IFF' item
  203.             bne.s   Item01_Ck
  204.             bra     EventDone
  205. Item01_Ck   cmpi.b  #1,d1                ;'Dump' item
  206.             bne.s   Item02_Ck
  207.             bra     EventDone
  208.  
  209. Item02_Ck   cmpi.b  #2,d1                ;'Title' item
  210.             bne.s   Item03_Ck
  211.             movea.l IntBase,a6
  212.             movea.l ScreenPtr,a0
  213.             tst.b   TitleFlag
  214.             beq.s   TitleOn
  215. TitleOff    move.l  #FALSE,d0            ;Hide title
  216.             move.b  #0,TitleFlag
  217.             bra.s   TitleFlip
  218. TitleOn     move.l  #TRUE,d0
  219.             move.b  #1,TitleFlag
  220. TitleFlip   call    ShowTitle
  221.             bra     EventDone
  222.  
  223. Item03_Ck   cmpi.b  #3,d1                ;'About' item
  224.             bne.s   Item04_Ck
  225.             movea.l IntBase,a6
  226.             movea.l WindowPtr,a1
  227.             lea     AboutReq,a0
  228.             call    Request              ;Put up the AboutReq
  229.             bra     EventDone
  230.  
  231. Item04_Ck   cmpi.b  #4,d1                ;'Quit' item
  232.             bne     EventDone            ;Last item in this menu
  233.             move.b  #1,CloseFlag         ;Set flag so we will exit
  234.             bra.s   EventDone
  235.  
  236. Menu1_Chk   cmpi.b  #1,d0                ;'Action' munu
  237.             bne.s   EventDone            ;Last menu in list
  238. Item10_Ck   cmpi.b  #0,d1                ;'Order' item
  239.             bne.s   Item11_Ck
  240. GetOrder    addq.b  #1,d2                ;1 >= Order >= 7
  241.             cmpi.b  #1,d2
  242.             blt     EventDone
  243.             cmpi.b  #7,d2
  244.             bgt     EventDone
  245.             ext.w   d2
  246.             move    d2,Order             ;SubItem number+1 = Order
  247.             move    d2,Store             ;Save for Replay
  248. Replay      movea.l MsgPtr,a1
  249.             bsr     RepMsg
  250.             bsr     SetCoords
  251.             bra     Main                 ;Last item in this menu
  252.  
  253. Item11_Ck   cmpi.b  #1,d1                ;'Color' item
  254.             bne.s   Item12_Ck
  255. Sub110_Ck   cmpi.b  #0,d2                ;'Color' subitem
  256.             bne.s   Sub111_Ck
  257.             move.b  #1,ColorFlag
  258.             bra.s   EventDone
  259. Sub111_Ck   cmpi.b  #1,d2                ;'B & W' subitem
  260.             bne.s   EventDone            ;Last item in this menu
  261.             move.b  #0,ColorFlag
  262.             bra.s   EventDone
  263.  
  264. Item12_Ck   cmpi.b  #2,d1                ;'Replay' item
  265.             bne.s   EventDone            ;Last item in this menu
  266.             move    Store,Order
  267.             bra.s   Replay
  268.  
  269. EventDone   movea.l MsgPtr,a1            ;Return msg
  270.             bsr     RepMsg
  271.             bra     Main
  272.  
  273. *****  Termination Section  *****
  274.  
  275. Cleanup     movea.l GfxBase,a6
  276.             move.l  FontPtr,d0           ;Close Font
  277.             beq.s   NoFont
  278.             movea.l d0,a1
  279.             call    CloseFont
  280.  
  281. NoFont      movea.l IntBase,a6           ;Detach the Menus
  282.             move.l  MenuFlag,d0
  283.             beq.s   NoMenu
  284.             movea.l WindowPtr,a0         ;Which window?
  285.             call    ClearMenuStrip
  286.  
  287. NoMenu      move.l  WindowPtr,d0         ;Close the Window
  288.             beq.s   NoWindow
  289.             movea.l d0,a0
  290.             call    CloseWindow
  291.  
  292. NoWindow    movea.l IntBase,a6           ;Close the Screen
  293.             move.l  ScreenPtr,d0
  294.             beq.s   NoScreen
  295.             movea.l d0,a0
  296.             call    CloseScreen
  297.  
  298. NoScreen    movea.l SysBase,a6           ;Close Intuition Library
  299.             move.l  GfxBase,d0
  300.             beq.s   NoGfx
  301.             movea.l d0,a1
  302.             call    CloseLibrary
  303.  
  304. NoGfx       move.l  IntBase,d0           ;Close Intuition Library
  305.             beq.s   NoInt
  306.             movea.l d0,a1
  307.             call    CloseLibrary
  308.  
  309. NoInt       clr.l   d0
  310.             rts                          ;Return to CLI
  311.  
  312. *****  Subroutines  *****
  313.  
  314. GetIMsg     clr.l   d0                   ;Clr return reg
  315.             movea.l SysBase,a6
  316.             movea.l PortPtr,a0
  317.             call    GetMsg               ;Get a message
  318.             tst.l   d0                   ;Got one?
  319.             beq.s   1$                   ;No
  320.             move.l  d0,a1                ;Ptr to msg
  321.             move.l  d0,MsgPtr            ;Save some stuff
  322.             move.l  im_Class(a1),MsgClass
  323.             move.l  im_Code(a1),MsgCode
  324.             move.l  im_IAddress(a1),MsgAddr
  325. 1$          rts
  326.  
  327. RepMsg      movea.l SysBase,a6           ;Ptr to msg in a1
  328.             call    ReplyMsg             ;Done with it
  329.             rts
  330.  
  331. SetCoords   movea.l GfxBase,a6
  332.             movea.l RastPtr,a1
  333.             moveq.l #0,d0                ;Color #0
  334.             call    SetBPen
  335.             movea.l RastPtr,a1
  336.             moveq.l #RP_JAM2,d0          ;Drawing mode
  337.             call    SetDrMd
  338.             movea.l RastPtr,a1
  339.             moveq.l #0,d0                ;Clear drawing area
  340.             call    SetRast              ; to Color #0
  341.             moveq.l #0,d2
  342.             move    Order,d2
  343.             moveq   #2,d4                ;dy = 768 / 2 ^ Order
  344.             lsl     d2,d4
  345.             move.l  #768,d5
  346.             divu    d4,d5
  347.             move    d5,dy
  348.             move    #-1,Turn             ;Turn = -1
  349.             move    #0,x                 ;x = 0
  350.             move    #12,y                ;y = 0
  351.             move    #0,dx                ;dx = 0
  352.             movea.l RastPtr,a1           ;Set pen point x,y
  353.             moveq.l #0,d0
  354.             moveq.l #12,d1
  355.             call    Move
  356.             bsr.s   Hilbert
  357.             rts
  358.  
  359. * Based on a recursive algorithm by Michael Ackerman - BYTE June 1986
  360.  
  361. Hilbert     subq    #1,Order             ;Order = Order - 1
  362.             neg     Turn                 ;Turn = -Turn
  363.             move    dy,temp              ;temp = dy
  364.             move    Turn,d2              ;dy = -Turn * dx
  365.             neg     d2
  366.             mulu    dx,d2
  367.             move    d2,dy
  368.             move    Turn,d2              ;dx = Turn * temp
  369.             mulu    temp,d2
  370.             move    d2,dx
  371.             move    Order,d0             ;If Order > 0 call Hilbert
  372.             beq.s   1$
  373.             bmi.s   1$
  374.             bsr.s   Hilbert
  375. 1$          move    x,d0                 ;x = x + dx
  376.             move    dx,d2
  377.             add     d2,d0
  378.             move    d0,x
  379.             move    y,d1                 ;y = y + dy
  380.             move    dy,d2
  381.             add     d2,d1
  382.             move    d1,y
  383.             bsr     PickColor
  384.             movea.l RastPtr,a1           ;Line relative x,y
  385.             ext.l   d0
  386.             ext.l   d1
  387.             call    Draw
  388.             neg     Turn                 ;Turn = -Turn
  389.             move    dy,temp              ;temp = dy
  390.             move    Turn,d2              ;dy = -Turn * dx
  391.             neg     d2
  392.             mulu    dx,d2
  393.             move    d2,dy
  394.             move    Turn,d2              ;dx = Turn * temp
  395.             mulu    temp,d2
  396.             move    d2,dx
  397.             move    Order,d0             ;If Order > 0 call Hilbert
  398.             beq.s   2$
  399.             bmi.s   2$
  400.             bsr     Hilbert
  401. 2$          move    x,d0                 ;x = x + dx
  402.             move    dx,d2
  403.             add     d2,d0
  404.             move    d0,x
  405.             move    y,d1                 ;y = y + dy
  406.             move    dy,d2
  407.             add     d2,d1
  408.             move    d1,y
  409.             bsr     PickColor
  410.             movea.l RastPtr,a1           ;Line relative x,y
  411.             ext.l   d0
  412.             ext.l   d1
  413.             call    Draw
  414.             move    Order,d0             ;If Order > 0 call Hilbert
  415.             beq.s   3$
  416.             bmi.s   3$
  417.             bsr     Hilbert
  418. 3$          move    dy,temp              ;temp = dy
  419.             move    Turn,d2              ;dy = -Turn * dx
  420.             neg     d2
  421.             mulu    dx,d2
  422.             move    d2,dy
  423.             move    Turn,d2              ;dx = Turn * temp
  424.             mulu    temp,d2
  425.             move    d2,dx
  426.             neg     Turn                 ;Turn = -Turn
  427.             move    x,d0                 ;x = x + dx
  428.             move    dx,d2
  429.             add     d2,d0
  430.             move    d0,x
  431.             move    y,d1                 ;y = y + dy
  432.             move    dy,d2
  433.             add     d2,d1
  434.             move    d1,y
  435.             bsr     PickColor
  436.             movea.l RastPtr,a1           ;Line relative x,y
  437.             ext.l   d0
  438.             ext.l   d1
  439.             call    Draw
  440.             move    Order,d0             ;If Order > 0 call Hilbert
  441.             beq.s   4$
  442.             bmi.s   4$
  443.             bsr     Hilbert
  444. 4$          move    dy,temp              ;temp = dy
  445.             move    Turn,d2              ;dy = -Turn * dx
  446.             neg     d2
  447.             mulu    dx,d2
  448.             move    d2,dy
  449.             move    Turn,d2              ;dx = Turn * temp
  450.             mulu    temp,d2
  451.             move    d2,dx
  452.             neg     Turn                 ;Turn = -Turn
  453.             addq    #1,Order             ;Order = Order + 1
  454.             rts
  455.  
  456. PickColor   move.w  #14,d3
  457.             bsr.s   Random               ;Get ramdom number 0-14
  458.             addq    #2,d2                ;Make 2-16
  459.             ext.l   d2                   ;Need LONG
  460.             movem.l d0/d1,-(sp)          ;Save regs
  461.             movea.l RastPtr,a1
  462.             moveq.l #2,d0                ;Color #2 for B/W
  463.             tst.b   ColorFlag            ;If = 0, use Color #2
  464.             beq.s   1$
  465.             move.l  d2,d0                ;Random color: 2-16
  466. 1$          call    SetAPen
  467.             movem.l (sp)+,d0/d1
  468.             rts
  469.  
  470. * Another random number generator.  By Leo Schwab.
  471. * Calling convention:  Random (range)
  472. *               Word:    d2     d3
  473.  
  474. Random      lea     RndSeed,a0           ;Get address of seed
  475.             tst.w   d3
  476.             ble.s   SetSeed              ;Go reset seed
  477.  
  478.             move.l  (a0),d2              ;Get seed
  479.             add.l   d2,d2
  480.             bhi.s   Over
  481.             eori.l  #$1D872B41,d2
  482. Over        move.l  d2,(a0)              ;Save new seed
  483.             andi.l  #$ffff,d2            ;Coerce into word
  484.             divu    d3,d2                ;Divide by range
  485.             swap    d2                   ; and get remainder (modulus)
  486.             rts
  487.  
  488. SetSeed     neg.w   d3                   ;Probably don't need this
  489.             move.l  d3,(a0)
  490.             rts
  491.  
  492.             SECTION data,DATA
  493.  
  494. IntBase     dc.l    0                    ;Keep address of Intuition here
  495. GfxBase     dc.l    0                    ;Address of Graphics library
  496. ScreenPtr   dc.l    0                    ;Addr of structure describing screen
  497. CMapPtr     dc.l    0                    ;Addr of ColorMap structure
  498. WindowPtr   dc.l    0                    ;Addr of structure describing window
  499. FontPtr     dc.l    0                    ;Addr of Font
  500. MenuFlag    dc.l    0                    ;Set if we call SetMenuStrip
  501.  
  502. RndSeed     dc.l    0
  503.  
  504. Order       dc.w    0                    ;Order of curve to draw
  505. Store       dc.w    0                    ;Last order, for replay
  506. Turn        dc.w    0
  507. dx          dc.w    0
  508. dy          dc.w    0
  509. x           dc.w    0
  510. y           dc.w    0
  511. temp        dc.w    0
  512.  
  513. IntName     dc.b    'intuition.library',0
  514. GfxName     dc.b    'graphics.library',0
  515. FontName    dc.b    'topaz.font',0
  516.  
  517. ScreenTitle dc.b    'HILBERT CURVES V0.6  -  by Jeff Lavin',0
  518.             cnop    0,4
  519.  
  520. MyScreen    dc.w    0,0,640,400,4        ;LeftEdge,TopEdge,Width,Height,Depth
  521.             dc.b    10,13                ;DetailPen,BlockPen
  522.             dc.w    V_HIRES!V_LACE       ;ViewModes
  523.             dc.w    CUSTOMSCREEN         ;Type
  524.             dc.l    MyFont               ;*Font
  525.             dc.l    ScreenTitle          ;*Title
  526.             dc.l    0,0                  ;*Gadgets,*CustomBitMap
  527.  
  528. NewColors   dc.w    $000,$D0D,$7AF,$FFF,$F00,$F09,$F80,$FD0
  529.             dc.w    $BF0,$0F0,$0FF,$00F,$12B,$C0F,$941,$888
  530.  
  531.             ;Black,Purple,SkyBlue,White,Red,Cherry,Orange,Yellow
  532.             ;LtGreen,Green,Aqua,Blue,DkBlue,Violet,Brown,Grey
  533.  
  534. MyIDCMP     equ     MENUPICK!REQCLEAR
  535. MyForm      equ     SMART_REFRESH!NOCAREREFRESH!ACTIVATE
  536. MyFeatures  equ     BACKDROP!BORDERLESS
  537.  
  538. MyWindow    dc.w    0,0,640,400          ;LeftEdge,TopEdge,Width,Height
  539.             dc.b    10,13                ;DetailPen,BlockPen
  540.             dc.l    MyIDCMP
  541.             dc.l    MyForm!MyFeatures
  542.             dc.l    0,0                  ;*FirstGadget,*CheckMark
  543.             dc.l    0                    ;*Title
  544.             dc.l    0                    ;*Screen
  545.             dc.l    0                    ;*BitMap
  546.             dc.w    0,0,0,0              ;MinWidth,Height,MaxWidth,Height
  547.             dc.w    CUSTOMSCREEN         ;Type
  548.  
  549. MyFont      dc.l    FontName             ;Font for Menus
  550.             dc.w    TOPAZ_EIGHTY         ;Height
  551.             dc.b    FS_NORMAL            ;Style
  552.             dc.b    FPF_ROMFONT          ;Flags
  553.  
  554. *** Text Strings
  555.  
  556. TtlText0    dc.b    ' Project',0
  557. ItemText00  dc.b       'Save IFF',0
  558. ItemText01  dc.b       'Screen Dump',0
  559. ItemText02  dc.b       'Hide Title',0
  560. ItemText03  dc.b       'About',0
  561. ItemText04  dc.b       'Quit',0
  562.  
  563. TtlText1    dc.b    ' Action',0
  564. ItemText10  dc.b       'Order',0
  565. SubText100  dc.b       '   1',0
  566. SubText101  dc.b       '   2',0
  567. SubText102  dc.b       '   3',0
  568. SubText103  dc.b       '   4',0
  569. SubText104  dc.b       '   5',0
  570. SubText105  dc.b       '   6',0
  571. SubText106  dc.b       '   7',0
  572. ItemText11  dc.b       'Color',0
  573. SubText110  dc.b       '   Color',0
  574. SubText111  dc.b       '   B & W',0
  575. ItemText12  dc.b       'Replay',0
  576.  
  577. *** Other Text Strings
  578.  
  579. AboutText1  dc.b    '*Amiga* Hilbert Curves!',0
  580. AboutText2  dc.b    'by Jeff Lavin',0
  581. AboutText3  dc.b    'Freely Distributable Grafix Software',0
  582. AboutText4  dc.b    'for the Amiga',0
  583. AboutText5  dc.b    '© 1987 The Puzzle Factory',0
  584. AGadText    dc.b    'OK',0
  585.  
  586.             cnop    0,4
  587.  
  588. *** IntuiText Structures
  589.  
  590. ItemITxt00  dc.l    $A0D0000,$10001,MyFont,ItemText00,0  ;"Save IFF"
  591. ItemITxt01  dc.l    $A0D0000,$10001,MyFont,ItemText01,0  ;"Screen Dump"
  592. ItemITxt02  dc.l    $A0D0000,$10001,MyFont,ItemText02,0  ;"Hide Title"
  593. ItemITxt03  dc.l    $A0D0000,$10001,MyFont,ItemText03,0  ;"About"
  594. ItemITxt04  dc.l    $A0D0000,$10001,MyFont,ItemText04,0  ;"Quit"
  595.  
  596. ItemITxt10  dc.l    $A0D0000,$10001,MyFont,ItemText10,0  ;"Order"
  597. SubITxt100  dc.l    $A0D0000,$10001,MyFont,SubText100,0  ;  "1"
  598. SubITxt101  dc.l    $A0D0000,$10001,MyFont,SubText101,0  ;  "2"
  599. SubITxt102  dc.l    $A0D0000,$10001,MyFont,SubText102,0  ;  "3"
  600. SubITxt103  dc.l    $A0D0000,$10001,MyFont,SubText103,0  ;  "4"
  601. SubITxt104  dc.l    $A0D0000,$10001,MyFont,SubText104,0  ;  "5"
  602. SubITxt105  dc.l    $A0D0000,$10001,MyFont,SubText105,0  ;  "6"
  603. SubITxt106  dc.l    $A0D0000,$10001,MyFont,SubText106,0  ;  "7"
  604. ItemITxt11  dc.l    $A0D0000,$10001,MyFont,ItemText11,0  ;"Color"
  605. SubITxt110  dc.l    $A0D0000,$10001,MyFont,SubText110,0  ;  "Color"
  606. SubITxt111  dc.l    $A0D0000,$10001,MyFont,SubText111,0  ;  "B & W"
  607. ItemITxt12  dc.l    $A0D0000,$10001,MyFont,ItemText12,0  ;"Replay"
  608.  
  609. *** MenuItem Structures
  610.  
  611. * Action Menu
  612. MenuItem12  ITEM          NULL,00,20,64,$052,000,ItemITxt12,0,NULL
  613. SubItem111  ITEM          NULL,52,10,80,$053,001,SubITxt111,0,NULL
  614. SubItem110  ITEM    SubItem111,52,00,80,$153,002,SubITxt110,0,NULL
  615. MenuItem11  ITEM    MenuItem12,00,10,64,$052,000,ItemITxt11,0,SubItem110
  616. SubItem106  ITEM          NULL,52,60,40,$053,063,SubITxt106,0,NULL
  617. SubItem105  ITEM    SubItem106,52,50,40,$053,095,SubITxt105,0,NULL
  618. SubItem104  ITEM    SubItem105,52,40,40,$053,111,SubITxt104,0,NULL
  619. SubItem103  ITEM    SubItem104,52,30,40,$053,119,SubITxt103,0,NULL
  620. SubItem102  ITEM    SubItem103,52,20,40,$053,123,SubITxt102,0,NULL
  621. SubItem101  ITEM    SubItem102,52,10,40,$053,125,SubITxt101,0,NULL
  622. SubItem100  ITEM    SubItem101,52,00,40,$153,126,SubITxt100,0,NULL
  623. MenuItem10  ITEM    MenuItem11,00,00,64,$052,000,ItemITxt10,0,SubItem100
  624.  
  625. * Project Menu
  626. MenuItem04  ITEM          NULL,00,40,130,$56,0,ItemITxt04,'Q',NULL
  627. MenuItem03  ITEM    MenuItem04,00,30,130,$56,0,ItemITxt03,'A',NULL
  628. MenuItem02  ITEM    MenuItem03,00,20,130,$56,0,ItemITxt02,'T',NULL
  629. MenuItem01  ITEM    MenuItem02,00,10,130,$46,0,ItemITxt01,'D',NULL
  630. MenuItem00  ITEM    MenuItem01,00,00,130,$46,0,ItemITxt00,'S',NULL
  631.  
  632. Title1      MENU      NULL,133,064,TtlText1,MenuItem10         ;Action Menu
  633. Title0      MENU    Title1,003,130,TtlText0,MenuItem00         ;Project Menu
  634.  
  635. *** IntuiText for AboutReq
  636.  
  637. AboutITxt1    dc.l    $D0000,$3C0014,MyFont,AboutText1,AboutITxt2
  638. AboutITxt2    dc.l    $D0000,$640028,MyFont,AboutText2,AboutITxt3
  639. AboutITxt3    dc.l    $D0000,$0F003C,MyFont,AboutText3,AboutITxt4
  640. AboutITxt4    dc.l    $D0000,$640050,MyFont,AboutText4,AboutITxt5
  641. AboutITxt5    dc.l    $D0000,$3C0064,MyFont,AboutText5,NULL
  642. AGadITxt      dc.l    $D0000,$120001,MyFont,AGadText,NULL
  643.  
  644. *** Requester Structure
  645.  
  646. AboutReq    dc.l    0               ;*OlderRequest
  647.             dc.w    160,25,320,150  ;LeftEdge,TopEdge,Width,Height
  648.             dc.w    0,0             ;RelLeft,RelTop
  649.             dc.l    AboutGad        ;*ReqGadget
  650.             dc.l    AboutBord       ;*ReqBorder
  651.             dc.l    AboutITxt1      ;*ReqText
  652.             dc.w    0               ;Flags
  653.             dc.b    13,0            ;BackFill,KludgeFill00
  654.             dcb.l   20,0
  655.  
  656. *** Border Structure
  657.  
  658. AboutBord   dc.w    0,0             ;LeftEdge,TopEdge
  659.             dc.b    0,1             ;FrontPen,BackPen
  660.             dc.b    RP_JAM1,10      ;DrawMode,Count
  661.             dc.l    AB_Coords       ;*XY
  662.             dc.l    NULL            ;*NextBorder
  663.  
  664. AB_Coords   dc.w    5,5,315,5,315,145,5,145,5,5
  665.             dc.w    4,4,314,4,314,144,4,144,4,4
  666.  
  667. *** Gadget Structure
  668.  
  669. AboutGad    dc.l    NULL            ;*NextGadget
  670.             dc.w    245,125,50,10   ;LeftEdge,TopEdge,Width,Height
  671.             dc.w    GADGHBOX!SELECTED ;Flags
  672.             dc.w    ENDGADGET       ;Activation
  673.             dc.w    REQGADGET!BOOLGADGET ;GadgetType
  674.             dc.l    NULL            ;*GadgetRender
  675.             dc.l    NULL            ;*SelectRender
  676.             dc.l    AGadITxt        ;*GadgetText
  677.             dc.l    0               ;MutualExclude
  678.             dc.l    NULL            ;*SpecialInfo
  679.             dc.w    1               ;GadgetID
  680.             dc.l    0               ;*UserData
  681.  
  682.             SECTION mem,BSS
  683.  
  684. RastPtr     ds.l    1                    ;Addr of Window's RastPort
  685. PortPtr     ds.l    1                    ;Addr of Window's UserPort
  686. ViewPtr     ds.l    1                    ;Addr of Screen's ViewPort
  687.  
  688. MsgClass    ds.l    1                    ;Class of msg
  689. MsgCode     ds.w    1                    ;Returned value
  690. MsgAddr     ds.l    1                    ;Ptr to an Intuition function
  691. MsgPtr      ds.l    1                    ;Ptr to received msg structure
  692. IntuiBits   ds.b    1
  693.  
  694. MenuNum     ds.b    1                    ;Menu number
  695. ItemNum     ds.b    1                    ;MenuItem number
  696. SubINum     ds.b    1                    ;SubItem number
  697.  
  698. CloseFlag   ds.b    1                    ;Flag to exit Main loop
  699. ColorFlag   ds.b    1                    ;0 = B/W, 1 = Color (default)
  700. TitleFlag   ds.b    1                    ;0 = NO,  1 = Title (default)
  701.  
  702.             END
  703.